Fix JENKINS-76283: httpRequest ignores default timeout 0 and enforces… #225
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix JENKINS-76283: httpRequest ignores default timeout 0 and enforces 5 minutes
When the timeout parameter is not provided or set to 0 (documented as 'no timeout'), httpclient5 was using its default 5-minute timeout instead.
This fixes the regression introduced in v1.22 during the httpclient5 migration (PR #197) by explicitly setting timeout to DISABLED when timeout <= 0, restoring the documented behavior.
Issue Description
According to the official documentation, the
timeoutparameter should default to0, meaning "no timeout". However, starting from version 1.22, when the timeout parameter is not provided, requests fail after approximately 5 minutes, indicating that a default timeout is being applied.This regression was introduced during the httpclient5 migration in PR #197. In httpclient4, not setting a RequestConfig meant infinite timeout. In httpclient5, if no RequestConfig is explicitly set, it uses a default timeout of 5 minutes.
Changes Made
Modified
HttpRequestExecution.javain theconfigureTimeoutAndSsl()method to explicitly set timeout toTimeout.DISABLEDwhentimeout <= 0, ensuring the documented "no timeout" behavior is restored.Testing done
mvn clean verify)timeoutis not specified or set to0, the HTTP request now waits indefinitely as documentedtimeout: 30) still works correctly and times out after the specified durationSubmitter checklist
Related Links